import { axios } from '@/utils/request'

/**
 * 查询流程配置列表
 * @param query
 * @returns {*}
 */
export function pageFlowConfig(query) {
  return axios({
    url: '/workflow/flowConfig/page',
    method: 'get',
    params: query
  })
}

/**
 * 查询流程配置详细信息
 * @param id
 * @returns {*}
 */
export function getFlowConfig(id) {
  return axios({
    url: '/workflow/flowConfig/' + id,
    method: 'get'
  })
}

/**
 * 查询流程节点配置详细信息
 * @param query
 * @returns {*}
 */
export function getConfigRule(query) {
  return axios({
    headers: { 'datasource': localStorage.getItem("dataName") },
    url: '/workflow/flowConfig/getConfigRule',
    method: 'get',
    params: query
  })
}

/**
 * 更新修改流程规则两个子表
 * @param data
 * @returns {*}
 */
export function updateConfigRule(data) {
  return axios({
    url: '/workflow/flowConfig/editConfigRule',
    method: 'post',
    data: data
  })
}

/**
 * 新增流程配置主
 * @param data
 * @returns {*}
 */
export function addFlowConfig(data) {
  return axios({
    url: '/workflow/flowConfig',
    method: 'post',
    data: data
  })
}

/**
 * 修改流程配置主表
 * @param data
 * @returns {*}
 */
export function updateFlowConfig(data) {
  return axios({
    url: '/workflow/flowConfig',
    method: 'put',
    data: data
  })
}

/**
 * 删除流程配置主表
 * @param id
 * @returns {*}
 */
export function delFlowConfig(id) {
  return axios({
    url: '/workflow/flowConfig/' + id,
    method: 'delete'
  })
}
